<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
	pageEncoding="ISO-8859-1"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<html>
<head>
<fmt:setBundle basename="ApplicationResources" />
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
<title><fmt:message key="title.maintainsch" /></title>
</head>
<body>
	<h2>
		<fmt:message key="title.maintainsch" />
	</h2>
	<form action="${pageContext.request.contextPath}/ScheduleController/searchsch"
		method=post>
		<center>
			<table class="framed">
				<tr>
					<th width="45%"><fmt:message key="caption.name" /></th>
					<th width="55%"><fmt:message key="caption.desc" /></th>
				</tr>
			<!--	<tr>
					<td><fmt:message key="fieldLabel.scheduleYear" /></td>
					<td><input type="text" name="scheduleYear" size=45 maxlength=45></td>
				</tr>-->
                                
                                <tr>
                                <td><fmt:message key="fieldLabel.scheduleYear" /></td>
                                <td><select  name="scheduleYear">  
                                            <c:forEach items="${yearList}" var="file">  
                                              <option>${file}</option>  
                                            </c:forEach>  
                                    </select></td>
                                </tr>
			<!--	<tr>
					<td><fmt:message key="fieldLabel.scheduleWeek" /></td>
					<td><input type="text" name="scheduleWeek" size=45 maxlength=45></td>
				</tr>-->
                                                                <tr>
                                <td><fmt:message key="fieldLabel.scheduleWeek" /></td>
                                <td><select  name="scheduleWeek">  
                                            <c:forEach items="${weekList}" var="file">  
                                              <option>${file}</option>  
                                            </c:forEach>  
                                    </select></td>
                                </tr>
				<tr>
					<td colspan="2" align="center"><input type="submit" value="Submit"> <input
						type="reset" value="Reset">

                                        </td>
				</tr>
			</table>
		</center>

	</form>
                                       <form action="${pageContext.request.contextPath}/controller/viewall"                                              
		method=post>
                                                                                     <input
						type="submit" value="View All Scheduled Programs">
                                        </form>
                <div>
                <a href="<c:url value="/controller/createsch"/>"> <fmt:message
						key="caption.menu.createsch" />
				</a>
                                            </div>
	<c:if test="${! empty  searchschlist}">
		<table class="borderAll">
			<tr>
                            <th><fmt:message key="label.schedule.date" /></th>
                            <th><fmt:message key="label.schedule.week" /></th>
                            <th><fmt:message key="label.schedule.time" /></th>
				<th><fmt:message key="label.schedule.radioprogram" /></th>
				<th><fmt:message key="label.schedule.presenter" /></th>
				<th><fmt:message key="label.schedule.producer" /></th>
                                <th><fmt:message key="label.schedule.delete" /></th>
                                <th><fmt:message key="label.schedule.modify" /></th>
			</tr>
			<c:forEach var="rprogram" items="${searchschlist}" varStatus="status">
				<tr class="${status.index%2==0?'even':'odd'}">
                                    <td claass="nowrap">${rprogram.dispDate}</td>
                                    <td claass="nowrap">${rprogram.week}</td>
                                     <td claass="nowrap">${rprogram.time}</td>

					<td class="nowrap">${rprogram.name}</td>
					<td class="nowrap">${rprogram.presenter}</td>
					<td class="nowrap">${rprogram.producer}</td>
                                        <td>
                                                                <c:url var="delurl" scope="page" value="/controller/delsch">
                            <c:param name="schName" value="${rprogram.name}"/>
                        </c:url>
                        <a href="${delurl}"><fmt:message key="label.schedule.delete"/></a>
                                        </td>
                                        <td>
                                                                    <c:url var="updurl" scope="page" value="/controller/modsch">
                            <c:param name="modName" value="${rprogram.name}"/>
                            <c:param name="modPresenter" value="${rprogram.presenter}"/>
                            <c:param name="modProducer" value="${rprogram.producer}"/>
                             <c:param name="insert" value="false"/>
                        </c:url>
                        <a href="${updurl}"><fmt:message key="label.crudrp.edit"/></a>
                                        </td>
				</tr>

			</c:forEach>
		</table>
	</c:if>

</body>
</html>